<?php
/**
* @author Tibor Pino (tibor.pino@gmail.com)
* @license released under GNU Public License v. 2
* @copyright Copyright (c) 2007, Tibor Pino
*
*/

class SeoComponent extends Object 
{
	
	/**
	 * vytvori seo odkaz
	 *
	 * @param string $string
	 */
	function create($str = "")
	{
		$url = $str;
        $url = preg_replace('~[^\\pL0-9_]+~u', '-', $url);
        $url = trim($url, "-");
        $url = iconv("utf-8", "us-ascii//TRANSLIT", $url);
        $url = strtolower($url);
        $url = preg_replace('~[^-a-z0-9_]+~', '', $url);

        return $url;
	}
}
?>